Fix/657 raster w2da missing vals#869
Open
nimra06 wants to merge 2 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #869 +/- ##
=====================================
Coverage 85.5% 85.5%
=====================================
Files 151 151
Lines 16092 16115 +23
=====================================
+ Hits 13758 13782 +24
+ Misses 2334 2333 -1
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pyteston your changes. Continuous integration will be run on all PRs with GitHub Actions, but it is good practice to test changes locally prior to a making a PR.pysal/masterbranch.docstrings and
unittests?
reviewer and added relevant labels
The issue turned out to be that when a raster has missing values, w2da() was being given data with the wrong length, usually the full flattened grid instead of just the valid cells. That caused a pretty confusing shape mismatch error. I added a guard to make sure the data length matches len(w.index) with a clearer error message that points out you need to pass only valid cell values. I also added two tests: one that actually hits the missing-values code path in _index2da and another that confirms we now raise a proper error when flattened data is passed in.
Fixes #657